home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / gnudev1.zip / emx / doc / emxgnu.doc < prev    next >
Text File  |  1996-09-08  |  59KB  |  1,704 lines

  1. ===============================================================================
  2. emxgnu.doc        emx 0.9c     GNU DEVELOPMENT TOOLS INFORMATION    09-Sep-1996
  3. ===============================================================================
  4.                                      Copyright (c) 1990-1996 by Eberhard Mattes
  5.  
  6. Table of Contents
  7. =================
  8.  
  9. 1       Introduction to GNU Development Tools Information
  10. 2       GCC -- compiling and linking C and C++ programs
  11. 2.1       Calling GCC
  12. 2.2       Environment variables
  13. 2.3       Bounds checking
  14. 2.4       #pragma statement
  15. 2.5       Additional command line options
  16. 2.5.1       -mepilogue
  17. 2.5.2       -mprobe
  18. 2.5.3       -pn
  19. 2.5.4       -Zbin-files
  20. 2.5.5       -Zbsd-signals
  21. 2.5.6       -Zcrtdll
  22. 2.5.7       -Zdll
  23. 2.5.8       -Zexe
  24. 2.5.9       -Zlinker
  25. 2.5.10      -Zmap
  26. 2.5.11      -Zmt
  27. 2.5.12      -Zmtd
  28. 2.5.13      -Zmts
  29. 2.5.14      -Zno-rte
  30. 2.5.15      -Zomf
  31. 2.5.16      -Zsmall-conv
  32. 2.5.17      -Zstack
  33. 2.5.18      -Zso
  34. 2.5.19      -Zsys
  35. 2.5.20      -Zsysv-signals
  36. 2.6       Special file extensions
  37. 2.7       Startup modules and libraries
  38. 2.8       Assertions
  39. 2.9       C++
  40. 2.10      Objective C
  41. 2.11      Stack probes
  42. 2.12      Other changes
  43. 2.13      Calling conventions
  44. 3       libg++ -- the GNU C++ library (gpp.a and gpp.lib)
  45. 4       libstdc++ -- the GNU standard C++ library
  46. 5       GDB -- debugging programs
  47. 5.1       Example
  48. 5.2       Restrictions
  49. 5.3       Special features
  50. 5.3.1       Setting command line arguments for the program being debugged
  51. 5.3.2       Running the debuggee in the same window
  52. 5.3.3       Switching sessions
  53. 5.3.4       Closing the window after termination of the debuggee
  54. 5.3.5       Debugging threads
  55. 5.3.6       Debugging DLLs
  56. 5.3.7       Debugging descendant processes
  57. 5.3.8       Examining the heap
  58. 5.3.9       Initialization file
  59. 5.3.10      DUEL
  60. 5.3.11      GDBRX -- use REXX in GDB
  61. 5.4       Hints
  62. 6       GAS -- assembling
  63. 7       ld -- linking
  64. 8       ranlib
  65. 9       strip -- removing the symbol table
  66. 10      info -- browsing info files
  67. 11      makeinfo -- creating info files
  68. 12      texindex -- creating the index for a printed manual
  69. 13      termcap -- terminal capabilities
  70. 14      readline
  71. 15      GPPDEMID -- an identifier manipulation DLL for G++
  72. 16      Known problems
  73.  
  74.  
  75. 1 Introduction to GNU Development Tools Information
  76. ===================================================
  77.  
  78. This text describes how to use the GNU C Compiler and other GNU
  79. utilities with emx.  See emxdev.doc for instructions for the emx
  80. utilities.  For detailed information about GCC, GDB, and GAS, read the
  81. GCC, GDB, and GAS manuals, see install.doc.  See build.doc for details
  82. on compiling the GNU utilities.
  83.  
  84. All programs assume that the entire package is installed on one disk
  85. drive in these directories:
  86.  
  87.     /emx/bin           Executable files
  88.     /emx/etc           termcap.dat
  89.     /emx/lib           Library files
  90.     /emx/include       Header files (C language)
  91.     /emx/include/cpp   Header files (C++ language)
  92.     /emx/include/objc  Header files (Objective C language)
  93.  
  94. If the /emx directory is not on the current drive, use the
  95. C_INCLUDE_PATH and LIBRARY_PATH environment variables, for instance
  96.  
  97.     set C_INCLUDE_PATH=c:/emx/include
  98.     set LIBRARY_PATH=c:/emx/lib
  99.  
  100. to use drive C.
  101.  
  102. Use forward slashes instead of backward slashes in path names!
  103.  
  104. Directories:
  105.  
  106.     /emx                            Main directory, empty
  107.     /emx/bin                        Executable files and batch files
  108.     /emx/dll                        Dynamic link libraries
  109.     /emx/doc                        Documentation
  110.     /emx/etc                        termcap.dat
  111.     /emx/gnu/binutils.old           old GNU binary utilities (sources)
  112.     /emx/gnu/binutils.26            new GNU binary utilities (sources)
  113.     /emx/gnu/doc                    Documentation
  114.     /emx/gnu/duel                   DUEL (for GDB)
  115.     /emx/gnu/gas-2.6                GNU assembler source (GAS)
  116.     /emx/gnu/gcc-2.7                GNU C compiler source (GCC)
  117.     /emx/gnu/gdb-4.16               GNU debugger source (GDB)
  118.     /emx/gnu/gppdemid               C++ demangler for LINK386
  119.     /emx/gnu/info                   GNU info source
  120.     /emx/gnu/libtxi                 -libtxi  (for GNU info)
  121.     /emx/gnu/libg++-2.7.2           GNU C++ libraries
  122.     /emx/gnu/makeinfo               GNU makeinfo source
  123.     /emx/gnu/termcap                GNU termcap
  124.     /emx/gnu/texindex               GNU texindex source
  125.     /emx/include                    header files (C language)
  126.     /emx/include/cpp                Header files (C++ language)
  127.     /emx/include/objc               Header files (Objective C language)
  128.     /emx/lib                        Libraries
  129.  
  130.  
  131. 2 GCC -- compiling and linking C and C++ programs
  132. =================================================
  133.  
  134. GCC 2.7.2.1 has been ported to emx, including Richard W.M. Jones's
  135. bounds checking patches.
  136.  
  137.  
  138. 2.1 Calling GCC
  139. ---------------
  140.  
  141. For small projects, one invokation GCC can be used to compile and link
  142. the program.  Example:
  143.  
  144.     gcc dwim.c
  145.  
  146. This assumes that emxl.exe can be found in one of the directories
  147. listed in the EMXPATH and PATH environment variables, or in the
  148. directory /emx/bin, see also ld.  If no output file name is given, the
  149. name of the first input file, with .exe extension (or .dll extension
  150. if -Zdll is given), is used for the output file unless linking is
  151. suppressed (with the -c option, for instance).  That is, the above
  152. example creates dwim.exe.
  153.  
  154. Please note that the example given above creates a file named dwim
  155. which will be deleted after conversion to .exe format.
  156.  
  157. If the output file name doesn't end in .exe or .dll, the output file
  158. will have a.out format (however, see -Zexe).  Example:
  159.  
  160.     gcc -o dwim dwim.c
  161.  
  162. This example creates the a.out file `dwim'.
  163.  
  164.  
  165. 2.2 Environment variables
  166. -------------------------
  167.  
  168. If you want to develop programs on a drive different from the drive
  169. where emx is installed, you have to set the C_INCLUDE_PATH and
  170. LIBRARY_PATH environment variables, for instance,
  171.  
  172.     set C_INCLUDE_PATH=c:/emx/include
  173.     set LIBRARY_PATH=c:/emx/lib
  174.  
  175. If you want to compile C++ programs, set CPLUS_INCLUDE_PATH as well:
  176.  
  177.     set CPLUS_INCLUDE_PATH=c:/emx/include/cpp;c:/emx/include
  178.  
  179. If you want to compile Objective C programs, set OBJC_INCLUDE_PATH as
  180. well:
  181.  
  182.     set OBJC_INCLUDE_PATH=c:/emx/include
  183.  
  184. The genclass utility needs the following environment variable:
  185.  
  186.     set PROTODIR=c:/emx/include/cpp/gen
  187.  
  188. If the TMPDIR, TMP and TEMP environment variables are not set, GCC
  189. writes temporary files in the current working directory.  GCC tries
  190. TMPDIR, TMP and TEMP in turn and uses the first valid one.  Note that
  191. c: is not a valid directory name, you have to use c:/ or \ instead.
  192. In other cases, a trailing slash or backslash is optional.  For
  193. instance, use
  194.  
  195.     SET TMPDIR=f:/tmp/
  196.  
  197. to put temporary files into the f:/tmp directory.
  198.  
  199. When compiling projects consisting of many modules (such as libraries)
  200. under OS/2, you can speed up compilation if you have enough memory by
  201. keeping GCC in memory.  For example, to keep GCC in memory for 5
  202. minutes, use
  203.  
  204.     set GCCLOAD=5
  205.  
  206. The following programs use GCCLOAD: gcc.exe, cpp.exe, cc1.exe,
  207. cc1plus.exe, cc1obj.exe, as.exe and emxomf.exe.
  208.  
  209. You can put GCC options into the environment variable GCCOPT.  These
  210. options will be read before the options given on the command line.
  211. For example, to use -pipe, type
  212.  
  213.     set GCCOPT=-pipe
  214.  
  215.  
  216. 2.3 Bounds checking
  217. -------------------
  218.  
  219. The emx port of GCC includes Richard W.M. Jones's bounds checking
  220. patches.  See the GCC manual and \emx\gnu\doc\bounds\README for
  221. details.  The complete report is in \emx\gnu\doc\bounds\bcrep2.ps
  222. (shipped in gnudoc.zip).  Use GhostScript if you don't have a
  223. PostScript printer.  \emx\gnu\doc\bounds\bcreport.txt contains
  224. important excerpts from an earlier version of the report as plain
  225. ASCII text.
  226.  
  227. There are a few additional restrictions under OS/2:
  228.  
  229. - Bounds checking is not available for multit